﻿<UserControl x:Class="Quizzer.Views.QuestionPage"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <StackPanel Orientation="Horizontal" Grid.Row="0">
            <Image Source="{Binding Image}" Width="100" Height="200"/>
            <StackPanel Orientation="Vertical">
                <Label Content="{Binding Text}"
                       FontSize="16"/>
                <TextBlock Text="{Binding Description}"
                           FontSize="14"/>
            </StackPanel>
        </StackPanel>
        
        <Grid Grid.Row="1">
            <ListView ItemsSource="{Binding AnswersList}" 
                      SelectionMode="{Binding SelectionMode}" 
                      SelectedItem="{Binding SelectedAnswer}"
                      Visibility="{Binding ListViewVisibility}">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <!--<RadioButton GroupName="Group1"/>-->
                            <StackPanel Orientation="Vertical">
                                <Image Source="{Binding Image}"/>
                                <Label Content="{Binding Text}"/>
                            </StackPanel>
                        </StackPanel>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
            <TextBox Text="{Binding CustomAnswer, UpdateSourceTrigger=PropertyChanged}" 
                     Visibility="{Binding TextBoxVisibility}"/>
        </Grid>
        
        <Button Command="{Binding GoToNextQuestion}" 
                Content="Next" 
                Grid.Row="2"
                HorizontalAlignment="Right"
                FontSize="16"
                BorderThickness="0"
                Background="White"
                IsDefault="True"/>
            
    </Grid>
</UserControl>
